{% extends 'virtualization/cluster/base.html' %}
{% load helpers %}
{% load plugins %}
{% load i18n %}

{% block content %}
<div class="row">
  <div class="col col-12 col-md-6">
    <div class="card">
      <h2 class="card-header">{% trans "Cluster" %}</h2>
      <table class="table table-hover attr-table">
        <tr>
          <th scope="row">{% trans "Name" %}</th>
          <td>{{ object.name }}</td>
        </tr>
        <tr>
          <th scope="row">{% trans "Type" %}</th>
          <td>{{ object.type|linkify }}</td>
        </tr>
        <tr>
          <th scope="row">{% trans "Status" %}</th>
          <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
        </tr>
        <tr>
          <th scope="row">{% trans "Description" %}</th>
          <td>{{ object.description|placeholder }}</td>
        </tr>
        <tr>
          <th scope="row">{% trans "Group" %}</th>
          <td>{{ object.group|linkify|placeholder }}</td>
        </tr>
        <tr>
          <th scope="row">{% trans "Tenant" %}</th>
          <td>
            {% if object.tenant.group %}
              {{ object.tenant.group|linkify }} /
            {% endif %}
            {{ object.tenant|linkify|placeholder }}
            </td>
        </tr>
        <tr>
          <th scope="row">{% trans "Scope" %}</th>
          {% if object.scope %}
            <td>{{ object.scope|linkify }} ({% trans object.scope_type.name %})</td>
          {% else %}
            <td>{{ ''|placeholder }}</td>
          {% endif %}
        </tr>
      </table>
    </div>
    {% include 'inc/panels/comments.html' %}
    {% plugin_left_page object %}
  </div>
  <div class="col col-12 col-md-6">
    <div class="card">
      <h2 class="card-header">{% trans "Allocated Resources" %}</h2>
      <table class="table table-hover attr-table">
          <tr>
              <th scope="row"><i class="mdi mdi-gauge"></i> {% trans "Virtual CPUs" %}</th>
              <td>{{ vcpus_sum|placeholder }}</td>
          </tr>
          <tr>
              <th scope="row"><i class="mdi mdi-chip"></i> {% trans "Memory" %}</th>
              <td>
                  {% if memory_sum %}
                      <span title={{ memory_sum }}>{{ memory_sum|humanize_ram_megabytes }}</span>
                  {% else %}
                      {{ ''|placeholder }}
                  {% endif %}
              </td>
          </tr>
          <tr>
              <th scope="row"><i class="mdi mdi-harddisk"></i> {% trans "Disk Space" %}</th>
              <td>
                  {% if disk_sum %}
                      {{ disk_sum|humanize_disk_megabytes }}
                  {% else %}
                      {{ ''|placeholder }}
                  {% endif %}
              </td>
          </tr>
      </table>
  </div>
    {% include 'inc/panels/related_objects.html' %}
    {% include 'inc/panels/custom_fields.html' %}
    {% include 'inc/panels/tags.html' %}
    {% plugin_right_page object %}
  </div>
</div>
<div class="row">
  <div class="col col-md-12">
    {% plugin_full_width_page object %}
  </div>
</div>
{% endblock %}
